package grad.nxu.recruitsystem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import grad.nxu.recruitsystem.domain.Admin;
import grad.nxu.recruitsystem.dto.User;
import grad.nxu.recruitsystem.mapper.AdminMapper;
import grad.nxu.recruitsystem.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author HAPPY
 * @description 针对表【admin】的数据库操作Service实现
 * @createDate 2023-03-09 22:59:06
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin>
        implements AdminService {
    @Autowired
    AdminMapper adminMapper;

    @Override
    public User login(User admin) {
        return adminMapper.login(admin);
    }

    @Override
    public int modifyPassword(String email, String password) {
        if (adminMapper.modifyPassword(email, password)) {
            return 1;
        } else {
            return 0;
        }
    }
}




